package vista;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VistaArbitro extends javax.swing.JFrame {
	private JPanel panArbitro;
	private JTextField txtNombre;
	private JButton btnAgregar;
	private JTextField txtCantidadPartidos;
	private JLabel lblCantidadPartidos;
	private JTextField txtFechaNacimiento;
	private JButton btnSalir;
	private JLabel lblFecha;
	private JTextField txtApellido;
	private JLabel lblApellido;
	private JLabel lblNombre;
	private JTextField txtCedula;
	private JLabel lblCedula;
	private JLabel lblTitulo;

	/**
	* Auto-generated main method to display this JFrame
	*/
		
	public VistaArbitro() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(null);
			{
				panArbitro = new JPanel();
				getContentPane().add(panArbitro);
				panArbitro.setLayout(null);
				panArbitro.setBounds(12, 12, 476, 277);
				{
					lblTitulo = new JLabel();
					panArbitro.add(lblTitulo);
					lblTitulo.setText("Datos del Arbitro");
					lblTitulo.setBounds(110, 12, 147, 16);
				}
				{
					lblCedula = new JLabel();
					panArbitro.add(lblCedula);
					lblCedula.setText("Cedula:");
					lblCedula.setBounds(17, 56, 73, 16);
				}
				{
					txtCedula = new JTextField();
					panArbitro.add(txtCedula);
					txtCedula.setBounds(196, 57, 117, 23);
				}
				{
					lblNombre = new JLabel();
					panArbitro.add(lblNombre);
					lblNombre.setText("Nombre:");
					lblNombre.setBounds(17, 103, 73, 16);
				}
				{
					txtNombre = new JTextField();
					panArbitro.add(txtNombre);
					txtNombre.setBounds(196, 100, 117, 23);
				}
				{
					lblApellido = new JLabel();
					panArbitro.add(lblApellido);
					lblApellido.setText("Apellido:");
					lblApellido.setBounds(17, 145, 73, 16);
				}
				{
					txtApellido = new JTextField();
					panArbitro.add(txtApellido);
					txtApellido.setBounds(196, 142, 117, 23);
				}
				{
					lblFecha = new JLabel();
					panArbitro.add(lblFecha);
					lblFecha.setText("Fecha:");
					lblFecha.setBounds(17, 193, 73, 16);
				}
				{
					txtFechaNacimiento = new JTextField();
					panArbitro.add(txtFechaNacimiento);
					txtFechaNacimiento.setBounds(196, 186, 117, 23);
				}
				{
					lblCantidadPartidos = new JLabel();
					panArbitro.add(lblCantidadPartidos);
					lblCantidadPartidos.setText("Num. Juegos Arbitrados:");
					lblCantidadPartidos.setBounds(17, 239, 185, 16);
				}
				{
					txtCantidadPartidos = new JTextField();
					panArbitro.add(txtCantidadPartidos);
					txtCantidadPartidos.setBounds(196, 236, 117, 23);
				}
			}
			{
				btnAgregar = new JButton();
				getContentPane().add(btnAgregar);
				btnAgregar.setText("Agregar");
				btnAgregar.setBounds(122, 311, 100, 23);
			}
			{
				btnSalir = new JButton();
				getContentPane().add(btnSalir);
				btnSalir.setText("Salir");
				btnSalir.setBounds(244, 311, 80, 23);
			}
			pack();
			this.setSize(372, 391);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	
	
	
	public JTextField getTxtNombre() {
		return txtNombre;
	}

	public JTextField getTxtCantidadPartidos() {
		return txtCantidadPartidos;
	}

	public JTextField getTxtFechaNacimiento() {
		return txtFechaNacimiento;
	}

	public JTextField getTxtApellido() {
		return txtApellido;
	}

	public JTextField getTxtCedula() {
		return txtCedula;
	}

	public void agregarListener(ActionListener accion){
		btnAgregar.addActionListener(accion);
		btnSalir.addActionListener(accion);
	}
	
	public void limpiarCajasTextos(){
		this.txtCedula.setText("");
		this.txtNombre.setText("");
		this.txtApellido.setText("");
		this.txtCantidadPartidos.setText("");
		this.txtFechaNacimiento.setText("");
		this.txtCedula.requestFocusInWindow();
	}

}